﻿@model IEnumerable<dae_2012_proyectofinal_comision5.Models.Evento>

@{
    ViewBag.Title = "Eventos";
}

<h2>Index</h2>

<p>
@using (Html.BeginForm())
{
    <p>
        Buscar por Nombre/Organizacion: @Html.TextBox("SearchString", ViewBag.CurrentFilter as string) &nbsp;
        <input type="submit" value="Buscar!" /></p>
}
	           

        </p>
<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
          @Html.ActionLink("Nombre", "TodosLosEventos", new { sortOrder = ViewBag.NameSortParm })
        </th>
        <th>
            Descripción
        </th>
        <th>
             @Html.ActionLink("Fecha", "TodosLosEventos", new { sortOrder = ViewBag.DateSortParm })
        </th>
        <th>
            Hora
        </th>

        <th>
            @Html.ActionLink("Lugar", "TodosLosEventos", new { sortOrder = ViewBag.LugarSortParm })
        </th>
        
        <th>
            @Html.ActionLink("Organizador", "TodosLosEventos", new { sortOrder = ViewBag.OrgSortParm })
        </th>
        <th>
            Participantes/Cupo
        </th>
        <th></th>
    </tr>

@foreach (var item in Model)
{
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Nombre)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Descripcion)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Fecha)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Hora)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Lugar)
        </td>
        
        <td>
            @Html.DisplayFor(modelItem => item.Organizador.Nombre)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Participantes.Count)/@Html.DisplayFor(modelItem => item.Cupo)
        </td>
        <td>
          
            @Html.ActionLink("Details", "Details", new { id = item.id }) 
           
           
        </td>
    </tr>
}

</table>
